package cate.common.table.res.treasureturntable.sheet;

import cate.common.table.ESheet;
import cate.common.table.res.treasureturntable.row.TreasureTurntableBaseRow;

import java.util.ArrayList;
import java.util.List;

public class TreasureTurntableBaseSheet extends ESheet<TreasureTurntableBaseRow> {
    @Override
    public String getSheetName() {
        return "转盘基础";
    }

    public TreasureTurntableBaseRow getRow(byte type, int level) {
        for (TreasureTurntableBaseRow row : getList()) {
            if (row.type == type && level <= row.level) {
                return row;
            }
        }
        return null;
    }

    public List<Byte> getTypes() {
        List<Byte> types = new ArrayList<>();
        for (TreasureTurntableBaseRow row : getList()) {
            if (!types.contains(row.type)) {
                types.add(row.type);
            }
        }
        return types;
    }
}
